//Array =>from
const bar=["a","b","c"];
var newArray1=Array.from(bar);
var  newArray2=Array.from('foo');

document.write(newArray1);
document.write('<br>');
document.write(newArray2);

let s=new Set(['foo',window]);
document.write('<br>'+Array.from(s)+'<br>');

let m=new Map([[1,2],[3,4],[5,6],[7,8]]);
console.log(Array.from(m));

function f(){
  console.log(arguments);
  return Array.from(arguments);
}
console.log(f(1,2,3));

console.log(Array.from([1,2,3],(x)=>x+x));
console.log(Array.from({length: 5},(v,i)=>i));

var f1=function(v,i){
  return i;
}


function combine(){
    let arr = [].concat.apply([], arguments);  //没有去重复的新数组
   console.log(arr);
    return Array.from(new Set(arr));
}
var m1 = [1, 2, 2], n1 = [2,3,3];
console.log(combine(m1,n1));
